﻿using ComprehensiveSystem.Model;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ComprehensiveSystem.Repository.UnitOfWork
{
    public static class DatabaseSelector
    {
        public static string GetConnectionStringKey<T>() where T : class
        {
            var type = typeof(T);
            var attribute = type.GetCustomAttributes(typeof(DatabaseTypeAttribute), false)
                                .FirstOrDefault() as DatabaseTypeAttribute;

            return attribute?.DbKey ?? "Base_Sap_Patient_ZY_NEW"; // 默认数据库  
        }
    }
}
